﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
//using PSE.ProcessManager.Common.Logging;
using System.IO;
using System.Management;
using PSE.Framework.Process;
using PSE.ProcessManager.Common.Process;

namespace PSE.ProcessManager.Server.Process.Executor
{
    internal class ProcessExecutor : AppDomainObject
    {
        private ProcessLoader _loader;

        public bool Run(string assemblyPath, string classFullName, string[] args)
        {
            //while (!System.Diagnostics.Debugger.IsAttached)
            //{
            //    Thread.Sleep(10);
            //}

            _loader = new ProcessLoader();

            return _loader.Initialize(assemblyPath, classFullName, args);
        }

        protected override PSE.Framework.Configuration.SystemComponent GetComponent()
        {
            return PSE.Framework.Configuration.Components.SystemComponents.System;
        }

        protected override PSE.Framework.Configuration.SystemComponent GetSystem()
        {
            return PSE.Framework.Configuration.Components.SystemComponents.Process;
        }
    }
}
